<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

<head>
<meta http-equiv="content-language" content="de" />
<meta http-equiv="content-type" content="text/html; charset=utf-8;" />
<title>users</title>
<link rel="stylesheet" type="text/css" href="css/users.css" media="all" />
<script src="../../javascripts/popupmenu.js" type="text/javascript"></script>
<script src="../../javascripts/popup.js" type="text/javascript"></script>
<script type="text/javascript">
	function change_view( view ){
		document.getElementById( "user_view").style.display = "none";
		document.getElementById( "group_view").style.display = "none";
		document.getElementById( view + "_view").style.display = "block";
	}

	function add_currentuser_membership( group ) {
		location.href = "index.php?user=<!--{$current_user.id}-->&addmembership=" + group;
	}
</script>
</head>

<body>

<div id="menubar">
<a href="" id="globaladd">Hinzufügen</a>
<a href="javascript:change_view('user');" id="userview">Benutzer</a>
<a href="javascript:change_view('group');" id="groupview">Gruppen</a>
</div>

<div id="user_view">

<div class="browser">
<!--{foreach from=$rail_users item=user}-->
<div onclick="location.href='index.php?user=<!--{$user.id}-->';"<!--{if $user.id eq $current_user.id}--> class="activ"<!--{/if}-->>
<p><!--{$user.name}--></p>
<p><!--{$user.username}--></p>
</div>
<!--{/foreach}-->
</div>

<form>
<p><span>rail ID:</span><!--{$current_user.id}--></p>
<p><span>Pfad:</span><!--{$current_user.path}--></p>

<label for="name"><span>Login:</span><input type="text" name="name" id="name" value="<!--{$current_user.name}-->" class="disabled"></input></label>
<label for="username"><span>Name:</span><input type="text" name="username" id="username" value="<!--{$current_user.username}-->"></input></label>
<label for="mail"><span>E-Mail:</span><input type="text" name="mail" id="mail" value="<!--{$current_user.mail}-->"></input></label>
<label for="passwd"><span style="padding-top: 0;">Neues Password:</span><input type="password" name="passwd" id="passwd" /></label>

<label id="membership">
<span>Gruppen:</span>
<select size="4">
<!--{foreach from=$memberships item=group}-->
<option value="<!--{$group.id}-->"><!--{$group.name}--><!--{if $group.is_current_users_group}--> (Primärgruppe)<!--{/if}--></option>
<!--{/foreach}-->
</select><a href=""><img src="css/img/edit_remove.png" border="0" /></a><a href=""><br /><img src="css/img/primary_group.png" border="0" /></a>
<br /><br /><br /><br /><br />
</label>

<label id="add_membership">
<select name="addmembership">
<!--{foreach from=$groups_available item=group}-->
<option value="<!--{$group.id}-->"><!--{$group.name}--></option>
<!--{/foreach}-->
</select><a href="javascript:add_currentuser_membership( document.getElementsByName('addmembership')[0].value );"><img src="css/img/edit_add.png" border="0" /></a></label>

<p><span>Aktualisiert:</span><!--{$current_user.time_lastwrite}--></p>
<p><span>Erstellt:</span><!--{$current_user.time_create}--></p>
<br />
<br />
<button>Speichern</button>
<button>Benutzer löschen</button>
</form>

</div>




<div id="group_view">

<div class="browser">
<!--{foreach from=$rail_groups item=group}-->
<div onclick="location.href='index.php?group=<!--{$group.id}-->';">
<p><!--{$group.name}--> (<!--{$group.members_size}-->)</p>
</div>
<!--{/foreach}-->
</div>

<form>
<p><span>rail ID:</span><!--{$current_group.id}--></p>
<p><span>Pfad:</span><!--{$current_group.path}--></p>
<label for="name"><span>Name:</span><input type="text" name="name" id="name" value="<!--{$current_group.name}-->" /></label>

<label id="members">
<span>Benutzer:</span>
<select size="4">
<!--{foreach from=$memberships item=group}-->
<option value="<!--{$group.id}-->"><!--{$group.name}--><!--{if $group.is_current_users_group}--> (Primärgruppe)<!--{/if}--></option>
<!--{/foreach}-->
</select><a href=""><img src="css/img/edit_remove.png" border="0" /></a>
<br /><br /><br /><br /><br /><br /><br />
</label>

<p><span>Aktualisiert:</span><!--{$current_user.time_lastwrite}--></p>
<p><span>Erstellt:</span><!--{$current_user.time_create}--></p>
<br />
<br />
<button>Speichern</button>
<button>Gruppe löschen</button>
</form>
</div>

<script type="text/javascript">
	change_view( "user" );
</script>
</body>

</head>